package Modele;

import java.util.LinkedList;
import java.util.Observable;

public class Modele extends Observable{

	private int state;
	private String selectedRestaurant = "";
	private LinkedList<Restaurant> listRestaurant;
	
	public Modele()
	{
		state = 6;
		listRestaurant = new LinkedList<Restaurant>();
	}
	
	public void ajouterRestaurant( Restaurant resto )
	{
		listRestaurant.add(resto);
	}
	
	public LinkedList<Restaurant> getRestaurants()
	{
		return this.listRestaurant;
	}
	
	public void authentificateUser( String arg0, String arg1 )
	{
		setChanged();
		notifyObservers(this);
	}
	
	public void choisirRestaurant(String selectedRestaurant)
	{
		setState(5);
		setSelectedRestaurant(selectedRestaurant);
		setChanged();
		notifyObservers(this);
	}
	
	public void setState(int state)
	{
		this.state = state;
	}
	
	public int getState()
	{
		return this.state;
	}
	
	public String getSelectedRestaurant()
	{
		return this.selectedRestaurant;
	}
	
	private void setSelectedRestaurant(String selectedRestaurant)
	{
		this.selectedRestaurant = selectedRestaurant;
	}

	public void retourListRestaurants() {
		setState(6);
		setChanged();
		notifyObservers(this);
	}
}
